home *** CD-ROM | disk | FTP | other *** search
/ PC PowerPlay 58 / pcpp58a.iso / extras / quake 3 source / Q3A_ToolSource.exe / Main / TexEdit.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-02  |  1.2 KB  |  65 lines

  1. // TexEdit.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "Radiant.h"
  6. #include "TexEdit.h"
  7.  
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13.  
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CTexEdit
  16.  
  17. CTexEdit::CTexEdit()
  18. {
  19.   m_pTexWnd = NULL;
  20. }
  21.  
  22. CTexEdit::~CTexEdit()
  23. {
  24. }
  25.  
  26.  
  27. BEGIN_MESSAGE_MAP(CTexEdit, CEdit)
  28.     //{{AFX_MSG_MAP(CTexEdit)
  29.     ON_WM_CTLCOLOR_REFLECT()
  30.     ON_CONTROL_REFLECT(EN_CHANGE, OnChange)
  31.     ON_WM_CREATE()
  32.     //}}AFX_MSG_MAP
  33. END_MESSAGE_MAP()
  34.  
  35. /////////////////////////////////////////////////////////////////////////////
  36. // CTexEdit message handlers
  37.  
  38. HBRUSH CTexEdit::CtlColor(CDC* pDC, UINT nCtlColor) 
  39. {
  40.   if (nCtlColor == CTLCOLOR_EDIT)
  41.   {
  42.     pDC->SetBkColor(RGB(192,192,192));
  43.       return (HBRUSH)GetStockObject(LTGRAY_BRUSH);
  44.   }
  45.   return NULL;
  46. }
  47.  
  48. void CTexEdit::OnChange() 
  49. {
  50.   CString str;
  51.   GetWindowText(str);
  52.   if (m_pTexWnd)
  53.     m_pTexWnd->UpdateFilter(str);
  54. }
  55.  
  56. int CTexEdit::OnCreate(LPCREATESTRUCT lpCreateStruct) 
  57. {
  58.     if (CEdit::OnCreate(lpCreateStruct) == -1)
  59.         return -1;
  60.  
  61.   m_Font.CreatePointFont(100, "Arial");
  62.     SetFont(&m_Font, FALSE);
  63.     return 0;
  64. }
  65.